package com.create.abstractd.factory;

/**
 * @author xiaobing
 * @version 1.0
 * @date 2021/9/6 3:16 下午
 */
public class ColorFactory extends AbstractFactory{

    @Override
    public Color getColor(String key) {
        switch (key) {
            case "Red":
                return new Red();
            case "Green":
                return new Green();
            default:
                return new DefaultColor();
        }
    }

    @Override
    Shape getShape(String key) {
        return null;
    }
}
